<?php

require "../seguranca/seguranca.php";
require "../mysql/mysql_connector.php";
require "../mysql/mysql_executa.php";

$tipoUsuario = $_SESSION["tipo"];
$id = $_SESSION["id"];

if($tipoUsuario == "user")
{	
	$sql_pagina_inicial = "SELECT (paginaInicial) FROM tb_confusuario WHERE id_confUsuario = '$id'";
	$rs = consultar($sql_pagina_inicial);
	$user_pagina_inicial = mysql_fetch_array($rs);
	$pagina_inicial = $user_pagina_inicial['paginaInicial'];
	
	header("Location: $pagina_inicial");
}
else
{
	header("Location: ../admin/admin.php");
}
?>